﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Document Interface Definition
 *      Provides a common definition for general document definition and manipulation.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;

namespace Adaptive.Foundation
{
    /// <summary>
    /// Provides a common definition for general document definition and manipulation.
    /// </summary>
    public interface IDocument
    {
        /*--------------------------------------------------------------------------------
         * Properties
         *------------------------------------------------------------------------------*/
        #region Properties
        /// <summary>
        /// Gets a value indicating whether the file has been loaded for editing.
        /// </summary>
        /// <value>
        /// <b>true</b> if the document is considered to be open; otherwise, <b>false</b>.
        /// </value>
        bool IsOpen { get; }
        /// <summary>
        /// Gets or sets the name of the file in which the data will be stored.
        /// </summary>
        /// <value>
        /// A fully-qualified path and file name.
        /// </value>
        string FileName { get; set; }
        /// <summary>
        /// Gets or sets the contents of the file.
        /// </summary>
        /// <value>
        /// The text contents read from disk and/or to be written to disk.
        /// </value>
        string Text { get; set; }
        #endregion

        /*--------------------------------------------------------------------------------
         * Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Methods / Functions
        /// <summary>
        /// Loads the content of the document into memory.
        /// </summary>
        /// <returns>
        /// <b>true</b> if the operation is successful; otherwise, <b>false</b>.
        /// </returns>
        bool Load();
        /// <summary>
        /// Saves the content of the document to disk.
        /// </summary>
        /// <returns>
        /// <b>true</b> if the operation is successful; otherwise, <b>false</b>.
        /// </returns>
        bool Save();
        #endregion
    }
}
